//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#if !defined(__ROT_H__)
#define __ROT_H__

typedef struct ExportObject : SLinkNode {
    oid_t             m_oid;
    IInterface         *m_pObject;
    IStub           *m_pIStub;
}   ExportObject;

typedef struct ImportObject : SLinkNode {
    oid_t             m_oid;
    IProxy          *m_pIProxy;
}   ImportObject;

extern DECL_CODEINIT void InitializeROT();

extern ECode RegisterKernExportObject(
        /* [in] */ oid_t oid,
        /* [in] */ IInterface *pObject,
        /* [in] */ IStub *pIStub);

extern ECode UnregisterKernExportObject(
        /* [in] */ oid_t oid);

extern ECode FindKernExportObject(
        /* [in] */ IInterface *pObject,
        /* [out] */ ExportObject *pExport);

extern ECode FindKernExportObject(
        /* [in] */ oid_t oid,
        /* [out] */ ExportObject *pExport);

extern ECode RegisterKernImportObject(
        /* [in] */ oid_t oid,
        /* [in] */ IProxy *pIProxy);

extern ECode UnregisterKernImportObject(
        /* [in] */ oid_t oid);

extern ECode FindKernImportObject(
        /* [in] */ oid_t oid,
        /* [out] */ ImportObject *pImport);

extern KMutex g_marshalLock;

#endif // __ROT_H__
